/**
 * 
 */
package org.xlab.baseframework.domain.view;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.xlab.baseframework.domain.SystemMessage;
import org.xlab.baseframework.domain.enumerate.EnumMessageType;
import org.xlab.baseframework.system.Declare;

/**
 * @author MaKuBEX
 * 
 */
public class SystemMessageVO extends
		AbstractNormalVersionControlViewObject<SystemMessage> {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = 6634697086510486977L;

	private Long id;
	private String message;
	private Date startDate;
	private Date endDate;
	private String destination;
	private EnumMessageType type;
	private String createdByName;
	private String lastUpdatedByName;

	private String s_startDate;
	private String s_endDate;

	public SystemMessageVO() {
		super();
	}

	public SystemMessageVO(SystemMessage pojo) {
		super(pojo);
		this.id = pojo.getId();
		this.message = pojo.getMessage();
		this.destination = pojo.getDestination();
		this.type = pojo.getType();
		this.createdBy = pojo.getCreatedBy();
		this.lastUpdatedBy = pojo.getLastUpdatedBy();
		this.createdByName = pojo.getCreatedByName();
		this.lastUpdatedByName = pojo.getLastUpdatedByName();
		SimpleDateFormat sdf = new SimpleDateFormat(
				Declare.SYSTEM_LONG_DATE_FORMAT + Declare.SPACE
						+ Declare.SYSTEM_LONG_TIME_FORMAT);
		this.createdTime = pojo.getCreatedTime();
		if (this.createdTime != null)
			this.s_createdTime = sdf.format(this.createdTime);
		this.lastUpdatedTime = pojo.getLastUpdatedTime();
		if (this.lastUpdatedTime != null)
			this.s_lastUpdatedTime = sdf.format(this.lastUpdatedTime);
		this.startDate = pojo.getStartDate();
		if (this.startDate != null)
			this.s_startDate = sdf.format(this.startDate);
		this.endDate = pojo.getEndDate();
		if (this.endDate != null)
			this.s_endDate = sdf.format(this.endDate);
	}

	/**
	 * @return the createdByName
	 */
	public String getCreatedByName() {
		return createdByName;
	}

	/**
	 * @return the destination
	 */
	public String getDestination() {
		return destination;
	}

	/**
	 * @return the endDate
	 */
	public Date getEndDate() {
		return endDate;
	}

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @return the lastUpdatedByName
	 */
	public String getLastUpdatedByName() {
		return lastUpdatedByName;
	}

	/**
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * @return the s_endDate
	 */
	public String getS_endDate() {
		return s_endDate;
	}

	/**
	 * @return the s_startDate
	 */
	public String getS_startDate() {
		return s_startDate;
	}

	/**
	 * @return the startDate
	 */
	public Date getStartDate() {
		return startDate;
	}

	/**
	 * @return the type
	 */
	public EnumMessageType getType() {
		return type;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @param message the message to set
	 */
	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * @param startDate the startDate to set
	 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	/**
	 * @param endDate the endDate to set
	 */
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	/**
	 * @param destination the destination to set
	 */
	public void setDestination(String destination) {
		this.destination = destination;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(EnumMessageType type) {
		this.type = type;
	}

	/**
	 * @param createdByName the createdByName to set
	 */
	public void setCreatedByName(String createdByName) {
		this.createdByName = createdByName;
	}

	/**
	 * @param lastUpdatedByName the lastUpdatedByName to set
	 */
	public void setLastUpdatedByName(String lastUpdatedByName) {
		this.lastUpdatedByName = lastUpdatedByName;
	}

	/**
	 * @param s_startDate the s_startDate to set
	 */
	public void setS_startDate(String s_startDate) {
		this.s_startDate = s_startDate;
	}

	/**
	 * @param s_endDate the s_endDate to set
	 */
	public void setS_endDate(String s_endDate) {
		this.s_endDate = s_endDate;
	}


}
